if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	
	SWEP.HoldType			= "smg"
	
end

if ( CLIENT ) then

	SWEP.PrintName			= "Skull Gun"			
	SWEP.Author				= "Slymask3"
	SWEP.Category			= "*Slymask3's SWEPs*"

	SWEP.Slot				= 5
	SWEP.SlotPos			= 7
	SWEP.ViewModelFOV		= 62
	SWEP.IconLetter			= "x"
    SWEP.DrawCrosshair = false
end

------------General Swep Info---------------
SWEP.Author   = "Slymask3"
SWEP.Contact        = "konny55@ymail.com"
SWEP.Purpose        = "Skulls xD"
SWEP.Instructions   = "Just use it!"
SWEP.Spawnable      = true
SWEP.AdminSpawnable  = true
-----------------------------------------------

------------Models---------------------------
SWEP.ViewModel      = "models/weapons/v_superphyscannon.mdl"
SWEP.WorldModel   = "models/hunter/misc/sphere025x025.mdl"
-----------------------------------------------

-------------Primary Fire Attributes----------------------------------------
SWEP.Primary.Delay			= 0.01 	--In seconds
SWEP.Primary.Recoil			= 0		--Gun Kick
SWEP.Primary.Damage			= 9999	--Damage per Bullet
SWEP.Primary.NumShots		= 1		--Number of shots per one fire
SWEP.Primary.Cone			= 0 	--Bullet Spread
SWEP.Primary.ClipSize		= 1	--Use "-1 if there are no clips"
SWEP.Primary.DefaultClip	= -1	--Number of shots in next clip
SWEP.Primary.Automatic   	= true	--Pistol fire (true) or SMG fire (true)
SWEP.Primary.Ammo         	= "none"	--Ammo Type
-------------End Primary Fire Attributes------------------------------------
 
-------------Secondary Fire Attributes-------------------------------------
SWEP.Secondary.Delay		= 0.9
SWEP.Secondary.Recoil		= 0
SWEP.Secondary.Damage		= 0
SWEP.Secondary.NumShots		= 1
SWEP.Secondary.Cone			= 0
SWEP.Secondary.ClipSize		= 1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic   	= true
SWEP.Secondary.Ammo         = "none"
-------------End Secondary Fire Attributes--------------------------------
 
function SWEP:Reload()
	self:drop()
end 
 
 
function SWEP:drop()
	-- if SERVER then
		-- local bar = ents.Create("pf_ball")
		-- bar:SetAngles(self.Owner:EyeAngles())
		-- bar:SetPos(self.Owner:GetShootPos() * 16)
		-- bar.owner = self.Owner
		-- bar:Spawn()
		-- local phys = bar:GetPhysicsObject()
		-- phys:ApplyForceCenter(self.Owner:GetAimVector() * 10000)
		-- self:Remove()
		-- self.Owner:Give("weapon_propgun")
		-- self.Owner:SelectWeapon("weapon_propgun")	
	-- end

end


function SWEP:Think() -- Called every frame
end

function SWEP:Initialize()

end

---------------------------------------------------------------------------

function SWEP:PrimaryAttack()
	self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER)
	if SERVER then
		local fire = false
		if(fire == false) then
			fire = true
			local bar = ents.Create("pf_ball")
			bar:SetAngles(self.Owner:EyeAngles())-- Angle(0,90,0))
			bar:SetPos(self.Owner:GetShootPos())
			--bar:SetOwner(self.Owner)
			--bar:SetPhysicsAttacker(self.Owner)
			bar.owner = self.Owner
			bar:Spawn()
			local phys = bar:GetPhysicsObject()
			phys:ApplyForceCenter(self.Owner:GetAimVector() * 1999999999)
			phys:AddAngleVelocity(Vector(0,5000000,0))
			self:Remove()
			self.Owner:Give("weapon_propgun")
			self.Owner:SelectWeapon("weapon_propgun")	
		end
	end
	--local e = self:drop()
	--e:Remove()
	
	--self.Entity:Remove()
	--local trail = util.SpriteTrail(bar, 0, team.GetColor(self.Owner:Team()), false, 15, 1, 4, 1/(15+1)*0.5, "trails/laser.vmt")

end

function SWEP:SecondaryAttack()
	
end

function SWEP:OnRemove()
	print("weapon removed")
	--self.Owner:SelectWeapon("weapon_propgun")	
end